﻿using MyCourseManageProject.Dal.Service;
using MyCourseManageProject.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyCourseManageProject.Bll
{
    public class TeachersBll
    {
        //创建讲师数据访问类对象
        private TeachersDal tdal = new TeachersDal();

        /// <summary>
        /// 讲师登录
        /// </summary>
        /// <param name="teacher"></param>
        /// <returns></returns>
        public Teachers TeacherLogin(Teachers teacher)
        {
            //调用后台数据访问方法
            return tdal.TeacherLogin(teacher);
            //如果需要获取用户权限,那么在这里可以调用权限读取方法...
            //ps:如果账号设置了有效性,有效性时效,则禁止读取权限

        }


        public bool Update(Teachers teacher, out string msg)
        {
           
           
                 
                int row = tdal.UpdateTeachers(teacher);
                if (row > 0)
                {
                    msg = "恭喜密码修改成功!";
                    return true;
                }
                else
                {
                    msg = "密码修改失败!";
                    return false;
                }
           
        }
    }
}
